"! "
UnitTest subclass: ArrayTest [
<category: ''>
"! "
testArraySimple [
|a|
a := Array new: 4.
self assert: ((a at: 1) isNil).
a at: 3 put: 42.
self assert: ((a at: 3) == 42).	]

"! "
testBounds [
|a ok|
a := Array new: 4.
" test low bound "
ok := false.
a at: 0 ifAbsent: [ ok := true ].
ok ifFalse: [ self error: #lowBounds ].
" test high bound "
ok := false.
a at: 5 ifAbsent: [ ok := true ].
ok ifFalse: [ self error: #lowBounds ].
" test in bounds "
a at: 3 ifAbsent: [ self error: #inBounds ].
]

"! "
testConcat [
|a b c|

a := #(1 2 3).
b := #(4 5 6).
c := a + b.
self assert: (a size == 3).
self assert: (b size == 3).
self assert: (c size == 6).
self assert: ((c at: 1) == 1).
self assert: ((c at: 4) == 4).
]

"! "
testEquals [
|a b|

self assert: (#(1 2 #three 4) = #(1 2 #three 4)).
self assert: (#(1) ~= #(1 2)).
]

"! "
testWith [
|a b|

a := Array with: 1 with: 2 with: 3.
self assert: (a size == 3).
self assert: ((a at: 1) == 1).
b := a with: 4.
self assert: (b size == 4).
self assert: ((b at: 4) == 4).
self assert: (a size == 3)
]

]

"! "
MetaUnitTest subclass: MetaArrayTest [
<category: ''>
]

